package com.vito.dcs.intface;

import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.dubbo.config.annotation.Reference;
import com.vito.base.authoriza.action.BaseAction;
import com.vito.base.model.Result;

/**
 *  查看质量、查看轨迹回放
 */
@Controller
@RequestMapping("/dcs/paverConstructionAction")
public class PaverConstructionAction  extends BaseAction {

    private static final Logger log = LoggerFactory.getLogger(PaverConstructionAction.class);

    @Reference
    private IntfaceService intfaceService;

    /**
     * 查看质量、查看轨迹 获取轨迹数据接口
     * @param map
     * @return
     */
    @RequestMapping("queryPaverConstruction")
    @ResponseBody
    public Result queryPaverConstruction(@RequestParam Map<String,String> map){
        Result rs = new Result();
        try{
            rs = intfaceService.queryAllSectionAndConstructionInfo(map);
        }catch (Exception e) {
            log.error("查询失败", e);
            rs.setCode(Result.CODE_ERROR);
            rs.setMsg("查询失败");
        }
        return rs;
    }
    /**
     * 实时查看轨迹数据接口
     * @param map
     * @return
     */
    @RequestMapping("queryRealTimeTrajectory")
    @ResponseBody
    public Result queryRealTimeTrajectory(@RequestParam Map<String,String> map){
        Result rs = new Result();
        try {
            rs = intfaceService.queryRealTimeTrajectory(map);
        } catch (Exception e) {
            log.error("查询失败", e);
            rs.setCode(Result.CODE_ERROR);
            rs.setMsg("查询失败");
        }
        return rs;
    }

}
